<!--
 * @Description: 
 * @version: 
 * @Author: 2956777131@qq.com
 * @Date: 2022-07-16 19:32:30
 * @LastEditors: 2956777131@qq.com
 * @LastEditTime: 2022-07-18 14:29:16
-->
<!DOCTYPE html>
<html>
  <head>
    <title><%= title %></title>
    <link rel='stylesheet' href='/stylesheets/style.css' />
  </head>
  <body>
    <h1><%= title %></h1>
    <button id="exit">退出登录</button>
    <p>Welcome to <%= title %></p>
  </body>
  <script>
    var exit = document.querySelector('#exit');

    exit.onclick = ()=>{
        fetch("/admin/logout").then(res=>res.json()).then(res=>{
          if(res.code===1){
            location.href = "/login";
          }else{
            document.writeln(res);
          }
          
        })
    }
  </script>
</html>
